-
Notifications
You must be signed in to change notification settings - Fork 14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adding State Checks for Known Type and Value, and Sensitive Checks #273
Closed
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…pe and value, and known value type and value (#243)
…tKnownOutputValueAtPaath (#243)
…merical value representation in the plan (#243)
…ove references to KnownValue interface (#243)
…ue, ExpectKnownOutputValue and ExpectKnownOutputValueAtPath (#243)
* Configuring when state checks are executed. * Testing that state checks are executed.
…or checking of null values (#266)
Co-authored-by: Brian Flad <[email protected]>
…243' into bendbennett/issues-243
I'm going to lock this pull request because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active contributions. |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Reference: #266
This PR forms part of the changes outlined in #266, specifically it includes state checks for the following:
ExpectKnownValue
ExpectKnownOutputValue
ExpectKnownOutputValueAtPath
ExpectSensitiveValue
The implementation in this PR differs from the way in which checks for known type and value are currently being handled for plan checks, in that the
ExpectKnown<Value|OutputValue|OutputValueAtPath>
state checks allow for explicitly checking for a null value by using a newly introduced null known value check type. An alternative can be seen in the plan check implementations, where theExpectKnown<Value|OutputValue|OutputValueAtPath>
plan checks return an error if a null value is found, and instead there are explicit checks for null values (e.g.,ExpectNullOutputValue
).In this context, a significant difference between
tfjson.Plan
andtfjson.State
is the handling of null output values. In the case oftfjson.Plan
, an output that specifies an attribute, for instance, which is null appears in the plan, whereas null output values do not appear instate (refer to Allow null value outputs to be present in json output). As a consequence, there is no way for state checks that leveragetfjson.State
to discriminate between output values that are null, and output values that do not exist. However, it is worth noting that output values that reference, for instance, an object that has attributes which are null will appear intfjson.State
.Together this raises the question of whether we want to:
ExpectKnown<Value|OutputValue|OutputValueAtPath>
to handle detection of nulls (to bring them into line with the state checks forExpectKnown<Value|OutputValue|OutputValueAtPath>
in this PR).ExpectKnown<Value|OutputValue|OutputValueAtPath>
in this PR to align their behaviour with the analogous plan checks (i.e., return an error when null is detected).Further Considerations
ExpectEmptyPlan
andExpectNonEmptyPlan
if there is possible value in having these built-in checks made available.